package com.stormrage.edu.serv.Index.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.stormrage.edu.dao.index.IdxQandaDao;
import com.stormrage.edu.serv.Index.IdxQandaServ;
import com.stormrage.entity.index.IdxQanda;
import com.stormragetech.core.exception.StormrageTechException;

/**
 * @Title: IdxQandaServImpl.java
 * @Package com.stormrage.edu.serv.Index.impl
 * @Description: 疑难问题 Service
 * @author www.stormragetech.com
 * @date 2016年4月16日
 * @version V1.0
 */
@Service
public class IdxQandaServImpl implements IdxQandaServ {

	private static final Logger logger = LoggerFactory.getLogger(IdxQandaServImpl.class);

	@Autowired
	private IdxQandaDao idxQandaDao;

	@Override
	public IdxQanda queryById(Integer arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】-【 IdxQandaServ 】-【 QueryList 】- 开始运行 ");

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", arg0);

		IdxQanda entity = idxQandaDao.queryById(map);

		logger.debug(" 【 Serv 】-【 IdxQandaServ 】-【 QueryList 】- 完成运行 ");
		return entity;

	}

	@Override
	public List<IdxQanda> queryList() throws StormrageTechException {

		logger.debug(" 【 Serv 】-【 IdxQandaServ 】-【 QueryList 】- 开始运行 ");

		List<IdxQanda> array = idxQandaDao.queryList();

		logger.debug(" 【 Serv 】-【 IdxQandaServ 】-【 QueryList 】- 完成运行 ");
		return array;

	}

}
